package com.hanserwei.mydemo.stream;

import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Stream;

public class GenerateTest4 {
    public static void main(String[] args) {
        // IntStream. generate
        Stream.generate(() -> ThreadLocalRandom.current().nextInt(10))
                .limit(10)
                .forEach(x -> System.out.print(x + " "));
    }

}
